const express = require("express");
const router = express.Router();
const {
  list,
  all,
  details,
  add,
  del,
  update,
  updateStatus,
  updateMenuIds,
  getRoleMenuIds,
} = require("../../controllers/system/rolesController");

/**
 * 查询所有权限信息
 * GTE  /roles/list
 */
router.get("/list", list);

/**
 * 获取所有列表数据
 * GET /roles/all
 */
router.get("/all", all);

/**
 * 查询权限详情
 * GET /roles/details
 */
router.get("/details", details);

/**
 * 新增权限
 * POST /roles/add
 */
router.post("/add", add);

/**
 * 删除权限
 * DELETE /roles/delete
 */
router.delete("/delete", del);

/**
 * 更新权限
 * PUT /roles/update
 */
router.put("/update", update);

/**
 * 更新状态
 * PUT /roles/updateStatus
 */
router.put("/updateStatus", updateStatus);

/**
 * 更新状态 menuId
 * PUT /roles/updateMenuIds
 */
router.put("/updateMenuIds", updateMenuIds);

/**
 * 获取角色管理-权限-菜单权限-根据角色 id 查对应菜单
 * GET /roles/getRoleMenuIds
 */
router.get("/getRoleMenuIds", getRoleMenuIds);

module.exports = router;
